import numpy as np

def fun(x,y):
    return x**2 + y**2
def gradient(x,y):
    return 2*x,2*y




def way():
    x = 100
    y = 100
    h = 0.1
    z0 = fun(x,y)
    delta_f = 10
    step = 0.1
    while delta_f > 0.0001:
        gradient_x, gradient_y = gradient(x,y)
        x = x - gradient_x * step
        y = y - gradient_y * step
        delta_f = z0 - fun(x,y)
        z0 = fun(x,y)
        print('x: ',x,'\t','y: ',y,'\t','z: ',fun(x,y),'\t','delta: ', delta_f)
way()
